﻿<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
		<meta name="apple-mobile-web-app-title" content="思路广惠">
		<title>个人资料修改</title>

		<meta content="telephone=no" name="format-detection" />

		<link rel="stylesheet" type="text/css" href="../../src/css/base.css?1.0" />
	</head>

	<body class="body-bg">
		<header class="header">
			<a href="javascript: history.go(-1);" class="head-le"><i class="iconfont icon-fanhui i2m"></i></a>
			<h1 class="header-txt"></h1>
		</header>
		<section class="top1rem">
			<ul class="setup-u">
				<li class="flexs-al forpwd setup-btm">
					<img class="forpwd-m" src="../../src/images/icon_password_large.png" />
					<input class="forpwd-inp" type="password" placeholder="旧密码" />
				</li>
				<li class="flexs-al forpwd setup-btm">
					<img class="forpwd-m" src="../../src/images/icon_password_large.png" />
					<input class="forpwd-inp" type="password" placeholder="新密码" />
				</li>
				<li class="flexs-al forpwd">
					<img class="forpwd-m" src="../../src/images/icon_password_large.png" />
					<input class="forpwd-inp" type="password" placeholder="确认密码" />
				</li>
			</ul>

			<div class="own-save">
				<button class="own-save-btn" id="subChange" type="button">
                确认修改
            </button>
			</div>
		</section>
		<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
		<script src="../../src/js/jquery-md5.js"></script>
		<script src="//cdn.bootcss.com/layer/3.0.1/mobile/layer.js"></script>
		<script src="../../src/js/all.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var byval = silks.getByVal("pwdID");
			var typepwd = $("input[type=password]");
			$(".header-txt").html(byval == "pay" ? "修改支付密码" : "修改登录密码");

			var getRespon = function() {
				var data = {
					MembersID: MembersID,
					PwdType: byval, // pay：支付密码，login：登陆密码
					PwdOld: $.md5(typepwd.eq(0).val()),
					PwdNew: $.md5(typepwd.eq(2).val()),
					AppID: AppID,
					Token: Token
				};
				$.post(urls + "/WorkMembers/EditPwd", data, function(res) {
					if(res.Return_ID == 0) {
						layers(res.Return_Mess, function() {
							history.go(-1);
						});
					} else {
						layers(res.Return_Mess);
					}
				});
			};

			$("#subChange").click(function() {
				if(typepwd.eq(0).val() == "") {
					layers("请输入旧密码");
				} else if(typepwd.eq(1).val() == "") {
					layers("请输入新密码");
				} else if(typepwd.eq(2).val() == "") {
					layers("请输入确认密码");
				} else if(typepwd.eq(2).val() !== typepwd.eq(1).val()) {
					layers("两次新密码不相同");
				} else {
					getRespon();
				}
			});
		</script>
	</body>

</html>